package com.hackintosh.oa;

/**
 * @description：
 * @author：twislyn
 * @date：Created in 2021/05/15
 * @modified By：
 * @version: 1.0
 */
public class OaTest {

    public static void main(String[] args) {
        Company root = new ConcreteCompany("北京总公司");
        root.add(new HRDepartment("总公司人力资源部"));
        root.add(new FinanceDepartment("总公司财务部"));

        Company comp = new ConcreteCompany("上海华东分公司");
        comp.add(new HRDepartment("华东分公司人力资源部"));
        comp.add(new FinanceDepartment("华东分公司财务部”"));
        root.add(comp);

        Company comp1 = new ConcreteCompany("南京办事处");
        comp1.add(new HRDepartment("南京办事处人力资源部"));
        comp1.add(new FinanceDepartment("南京办事处财务部”"));
        comp.add(comp1);

        Company comp2 = new ConcreteCompany("杭州办事处");
        comp2.add(new HRDepartment("杭州办事处人力资源部"));
        comp2.add(new FinanceDepartment("杭州办事处财务部”"));
        comp.add(comp2);

        Company comp3 = new ConcreteCompany("合肥办事处");
        comp.add(comp3);

        System.out.println("结构图：");
        root.display(1);

        System.out.println("职责：");
        root.lineOfDuty();
    }

}
